package engine.newUi
{
	import engine.GameData;
	import engine.control.loading.MultLoader;
	import engine.data.BindManage;
	import engine.data.ModelLocator;
	import engine.data.ResPath;
	import engine.display.newAttack.AttackLogic;
	import engine.event.SceneEvent;
	import engine.flag.GameDefine;
	import engine.flag.ResourcesPath;
	import engine.logic.ClearCDTimeLogic;
	import engine.logic.LogSendLogic;
	import engine.logic.MenuListManager;
	import engine.logic.ServerTimerLogic;
	import engine.logic.event.LogicEvent;
	import engine.logic.login.PlayCDTimerLogic;
	import engine.logic.login.ProtectionLogin;
	import engine.logic.login.WaitingForScene;
	import engine.logic.tips.TipsManage;
	import engine.net.datatype.WString;
	import engine.net.event.CustomMsgEvent;
	import engine.net.messages.CustomToClientFlag;
	import engine.net.messages.CustomToServerFlag;
	import engine.net.mgr.SystemSender;
	import engine.scene.SceneChangeManager;
	import engine.scene.SceneManager;
	import engine.tip.TipsMainLogic;
	import engine.ui.MainUIManager;
	import engine.ui.lite.BaseUI;
	
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.MovieClip;
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.events.TextEvent;
	import flash.events.TimerEvent;
	import flash.filters.GlowFilter;
	import flash.system.ApplicationDomain;
	import flash.text.StyleSheet;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.utils.Timer;
	
	import newx.StageInfo;
	import newx.com.ResManager;
	import newx.com.config.StaticIni;
	import newx.com.control.NxClip;
	import newx.com.control.button.NxButton;
	import newx.com.control.group.NxViewGroup;
	import newx.com.control.text.NxLabel;
	import newx.com.control.text.NxText;
	
	/**
	 * ...
	 * @author ...WangHaiBo 
	 * ...........www.woniu.com
	 */
	public class PkListUI extends BaseUI 
	{
		public var BG				:NxClip;
		public var PlayView		:NxViewGroup;
//		public var PlayView1		:NxViewGroup;

		public var MyAvter			:NxClip;
		public var back1			:NxClip
		public var back2			:NxClip
		public var infoLabel_0		:NxLabel;
		public var infoLabel_1		:NxLabel;
//		public var infoLabel_2		:NxLabel;
		public var infoLabel_3		:NxLabel;
		public var infoLabel_4		:NxLabel;
		public var infoLabel_5		:NxLabel;
		public var infoLabel_6		:NxLabel;
		
		public var rewardMc1		:NxClip;
		public var rewardMc2		:NxClip;
		public var rewardMc3		:NxClip;
		public var rewardMc4		:NxClip;
		public var rewardMc5		:NxClip;

		public var title			:NxClip;
		public var downBack		:MovieClip
		public var topBack			:MovieClip
		public var pkInfo			:NxClip;
		public var pkLTxt			:NxText;
//		public var roleInfoBack	:MovieClip
		
		
		public var addNumBtn		:NxButton;
		public var clearCDBtn		:NxButton;
		public var closeBtn		:NxButton;
		
		public var role		:NxButton;
		public var pack		:NxButton;
		public var line		:NxButton;
		public var lineup		:NxButton;
		public var channel		:NxButton;
		public var strong		:NxButton;
		public var kungfu		:NxButton;
		public var exitBtn		:NxButton;
		
		public var jianglibgmc:NxClip;
		public var shenyucishumc:NxClip;
		
		private static var _self	:PkListUI;
		private var _model			:ModelLocator;
		private var _bindManage		:BindManage;
		private var _MoneyNum		:String;
		private var _PreNum			:String

		
		//查看排行榜
		private var _listText:TextField;
		//当前玩家的模型ID号
		private var _myModelID:String;
		//玩家模型
		private var photoMc:MovieClip;
		//挑战信息
		private var _infoStr:String;
		//当前玩家排名
		private var _top:int	=	0;
		//排名对应的奖励
		private var _prizeGold:int	=	0;
		//领取剩余时间
		private var _prizeTime:int	=	0;
		//冷却时间
		private var _pkEnableTime:int	=	0;
		//可挑战的次数
		private var _leftChallengeCount:int	=	0;
		//挑战玩家信息的数据长度
		private var pkinforPalyNum:int	=	7;
		//挑战玩家数组
		private var palyList:Array;
		//剩余时间秒
		private var _haveTime:Number;
		//计时器
		private var _timer:Timer;
		private var blackBack:Sprite;
		private var _pkListInfoArray	:Array;
		
		//是否在排名竞技场
		private var _isPK:int;
		private var _vipLevel:int;
		private var _curCloneChallengeTimesIndex:int = -1;
		private var _curAddCloneChallengeIndex:int		=	-1;
		private var _checkVIPObj:Object	=	{};
		private var _btnListArray:Array;
		
		private var _mask : Shape;
		
		//平移距离
		private var _moveRange:Number = 0;
		private var _onewidth:Number = 113.5;
		private var _tempList:Array = [];
		//当前差值
		private var _dvalue:int = 0;
		//遮罩层
		private var _square:Sprite;
		//当前查看的战报；
		private var _currSeeWarfar:int;
		public function PkListUI()
		{

		}
		public static function getInstance():PkListUI
		{
			if (_self == null) 
			{
				_self = new PkListUI();
			}
			return _self;
		}
		override public function Init() : void
		{
			
			_btnListArray			=	[];
			palyList	=	[];

			_btnListArray.push(kungfu);
			_btnListArray.push(channel);
			_btnListArray.push(strong);
			_btnListArray.push(lineup);
			_btnListArray.push(line);
			_btnListArray.push(pack);
			_btnListArray.push(role);

			_checkVIPObj			=	StaticIni.getIniObj("PKListUI_VIP");
			blackBack				=	new Sprite();
			this.addChildAt(blackBack,0);
//			blackBack.graphics.beginFill(0x000000,.7);
//			blackBack.graphics.drawRect(0,0,1280 * 3,768 *3);
//			blackBack.graphics.endFill();
			blackBack.x = -(1280 /2);
			blackBack.y = -(768 /2);
			infoLabel_0.htmlStrByBorder	=	"";
			infoLabel_1.htmlStrByBorder	=	"";
//			infoLabel_2.htmlStrByBorder	=	"";
			infoLabel_3.htmlStrByBorder	=	"";
			infoLabel_4.htmlStrByBorder	=	"";
			infoLabel_5.htmlStrByBorder	=	"";
			infoLabel_6.htmlStrByBorder	=	"";
			MyAvter.mouseChildren	=	false;
			MyAvter.mouseEnabled	=	false;
			clearCDBtn.visible		=	false;
			infoLabel_0.color		=	0x00FF40;
			_listText				=	new TextField();
			_listText.x				=	infoLabel_5.x
			_listText.y				=	infoLabel_5.y  + 65;
			addNumBtn.visible		=	false
			infoPic( PlayView );
//			infoPic( PlayView1 );
			clearPhot(PlayView);
//			clearPhot(PlayView1);
			this.addChild(_listText);
			_timer			=	new Timer(1000);
			_model			=	ModelLocator.getInstance();
			_bindManage		=	BindManage.getInstance();
			
			PlayCDTimerLogic.getInstance().resgis(12,CDTimerHandle);
			_listText.selectable =false
			_listText.autoSize =TextFieldAutoSize.LEFT
			_listText.htmlText ="<a href='event:"+"'>"+ StaticIni.getSwfLangStr("RankWar_6")+"</a>"
			var txtStyle:StyleSheet	=	new StyleSheet();
			
			//link,visited,hover
			txtStyle.setStyle("a:link"		,{color:"#"+StaticIni.getIniVar("Css_a_Task","hover"),textDecoration:"underline"});
			txtStyle.setStyle("a:visited"	,{color:"#"+StaticIni.getIniVar("Css_a_Task","visited")});
			txtStyle.setStyle("a:hover"	,{color:"#"+StaticIni.getIniVar("Css_a_Task","visited"),textDecoration:"none"});
			
			_listText.styleSheet = txtStyle;
			_listText.addEventListener(MouseEvent.CLICK, linkHandler);
			
			_model.	addEventListener(	SceneEvent.SceneLoaded, onSceneLoaded);
			_model			.addEventListener(	String(CustomToClientFlag.SERVER_CUSTOMMSG_SEND_CLONE_CHALLENGE_INFO), onUpdatePlay);
			
			_model			.addEventListener(	String(CustomToClientFlag.SERVER_CUSTOMMSG_CLONE_CHALLENGE_HISTORY), onUpdatePkInfo);
			_bindManage.BindProp(_model.scene.Role,"IsCloneChallenge",this,"isPK");
			_bindManage.BindProp(_model.scene.Role,"VIPLevel",this,"vipLevel");
			_bindManage.BindProp(_model.scene.Role,"Level",this,"level");
			addListent();
			
			_mask = new Shape();
			_mask.graphics.beginFill(0xFF8800);
			_mask.graphics.drawRect(0,0,width,height);
			_mask.graphics.endFill();
			addChild( _mask );
			_mask.visible =false;
			this.mask = _mask;
			
			//遮罩
			_square = new Sprite();
			_square.graphics.beginFill(0xFF0000);
			_square.graphics.drawRect(0, 0, 691, 200);
			PlayView.addChild(_square);
			PlayView.mask = _square;
		}

		/**
		 * 设定可挑战次数
		 */
		public function set curCloneTimes(val:int):void
		{
			//addNumBtn.enabled		=	true;
			_leftChallengeCount		=	val;
			infoLabel_3.htmlStrByBorder	=	StaticIni.getSwfLangStrVar("RankWar_4", [_leftChallengeCount]);
		}
		public function getPkTitle(val:int):String
		{
			var titleStr:String	=	StaticIni.getSwfLangStr("UIStr_1001722");
			if (val ==1 )
			{
				titleStr	=	StaticIni.getSwfLangStr("UIStr_1001717");
			}
			else if (val <=	5 )
			{
				titleStr	=	StaticIni.getSwfLangStr("UIStr_1001716");
			}
			else if (val <= 20) 
			{
				titleStr	=	StaticIni.getSwfLangStr("UIStr_1001718");
			}
			else if ( val <= 100) 
			{
				titleStr	=	StaticIni.getSwfLangStr("UIStr_1001719");
			}
			else if ( val <= 200) 
			{
				titleStr	=	StaticIni.getSwfLangStr("UIStr_1001720");
			}
			else if (val <= 500) 
			{
				titleStr	=	StaticIni.getSwfLangStr("UIStr_1001721");
			}
			return titleStr;
		}
		public function set isPK(value:int):void
		{
			_isPK = value;
		}
		public function checkShowUI():void
		{
			if(_isPK)
			{
				WaitingForScene.start();
				SystemSender.getInstance().CustomMsg(CustomToServerFlag.CLIENT_CUSTOMMSG_ENTRY_CLONE_PLAYER_ROOM);
			}
		}
		public function changeLocation():void
		{
			this.x	=	SceneChangeManager.attackSceneViewX;
			this.y	=	SceneChangeManager.attackSceneViewY;
		}

		/**
		 * 设定玩家形像
		 */
		public function set playPhoto(val:String ):void
		{
			var myAvterModel:String	=	String(_model.scene.Role.getPlayNation()) + String(_model.scene.Role.getPlayerProf()) + String(_model.scene.Role.getPlaySex());
			var playModelObj:Object	=	StaticIni.getIniObj("RoleModel");
			if (playModelObj	!= null) 
			{
				myAvterModel	=	playModelObj[myAvterModel];
			}
			var url:String	=	"res/LoginRes/log_" + myAvterModel + ".swf";
			ResManager.loadResNoSave(url, url, onPhotoLoad,[url]);
			infoLabel_4.htmlStrByBorder	=	StaticIni.getSwfLangStrVar("RankWar_7",[_model.scene.Role.getPlayerName()]);
		}
		/**
		 * VIP等级变化 
		 * @param val
		 * 
		 */		
		public function set vipLevel(val:int):void
		{
			var index:int =1;
			if(val >= _checkVIPObj["ADDNum_VIPLevel"])
			{
				addNumBtn.visible	=	true
			}
			else
			{
				addNumBtn.visible	=	false
			}
		}
		/**
		 * 人物等 
		 * @param val
		 * 
		 */		
		public function set level(val:int):void
		{
			var index:int =1;
			role.visible	=	true;
			pack.visible	=	true;
			line.visible	=	true;
			lineup.visible	=	true;
			channel.visible	=	true;
			kungfu.visible	=	true;
			strong.visible	=	true;
			
			if(val < _checkVIPObj["Role"])
			{
				role.visible	=	false;
			}
			if(val < _checkVIPObj["pack"])
			{
				pack.visible	=	false;
			}
			if(val < _checkVIPObj["Line"])
			{
				line.visible	=	false;
			}
			if(val < _checkVIPObj["Lineup"])
			{
				lineup.visible	=	false;
			}
			if(val < _checkVIPObj["Channel"])
			{
				channel.visible	=	false;
			}
			if(val < _checkVIPObj["Kungfu"])
			{
				kungfu.visible	=	false;
			}
			if(val < _checkVIPObj["Strong"])
			{
				strong.visible	=	false;
			}
			for(var i:int = 0; i < _btnListArray.length; i++)
			{
				var checkItem:NxButton	=	_btnListArray[i] as NxButton;
				if(checkItem.visible)
				{
					checkItem.x	=	closeBtn.x - (index * 45 +5);
					index++;
				}
			}
		}
		/**
		 * 图片加载完成
		 * @param	val
		 * @param	pList
		 */
		private function onPhotoLoad(val:DisplayObject,pList:Array):void
		{
			photoMc = val as MovieClip;
			MyAvter.source = photoMc;
		}
		private function onSceneLoaded(e:SceneEvent):void
		{
			getCD();
			_model.removeEventListener(	SceneEvent.SceneLoaded, onSceneLoaded);
		}
		
		private function getCD():void
		{
			SystemSender.getInstance().CustomMsg(CustomToServerFlag.CLIENT_CUSTOMMSG_GET_CLONE_CHALLENGE_LETF_TIME);
		}
		
		private function hasElement(list:Array,obj:Object):Boolean{
			for(var i:int = 0;i < list.length;i++){
//				if( obj.name == list[i].name && obj.top == list[i].top && obj.level == list[i].level){
				if( obj.name == list[i].name) {
					return true;	
				}
			}
			return false;
		}
		
		/**
		 * 更新挑战信息
		 * @param	e
		 */
		private function onUpdatePlay(e:CustomMsgEvent):void
		{
			WaitingForScene.end();
			var oldTop : int 	=	_top;
			_top				=	e.pList.shift()
			_prizeGold			=	e.pList.shift()
			_prizeTime			=	e.pList.shift()
			e.pList.shift()
			_tempList			 = [];
			var przObj:Object	=	StaticIni.getIniObj("TopPrize");
			var topArray:Array	=	String(przObj[_top]).split(",")
			_MoneyNum			=	topArray[0];
			_PreNum				=	topArray[1];
			var maxIndex:int	=	e.pList.length / pkinforPalyNum;
			
			for (var i:int = 0; i < maxIndex; i++) 
			{
				var playObj:Object	=	{ };
				var index:int		=	pkinforPalyNum * i;
				playObj["name"]		=	e.pList[index ];
				playObj["top"]		=	e.pList[index + 1];
				playObj["level"]	=	e.pList[index + 2];
				playObj["model"]	=	e.pList[index + 3];
				playObj["prof"]		=	e.pList[index + 4];//职业
				playObj["warPower"]	=	e.pList[index + 5];//战斗力
				playObj["clotheModel"] =	e.pList[index + 6];//时装ID
				playObj["title"]	=	getPkTitle(playObj["top"]);
				topArray			=	String(przObj[e.pList[index + 1]]).split(",");
				playObj["moneyNum"]	=	topArray[0];
				playObj["preNum"]	=	topArray[1];
				_tempList.push(playObj);
			}
			if(palyList.length == 0){
				palyList = _tempList;
			}else {
				var arr:Array	=	[];
				var length:int	=	_tempList.length;
				for(var j:int = 0;j<length;j++)
				{
					var contained:Boolean = hasElement(palyList,_tempList[j]);
					if(!contained){
						arr.push(_tempList[j]);
					}
				}
				palyList	=	palyList.concat(arr);
				var len:int = palyList.length;
				if(len > 10){
					palyList.slice(len - 10, len);
				}
			}
			
			//获得所需平移距离
			for(i = 0;i<palyList.length;i++){
				if(palyList[i].name == _tempList[0].name){
					_dvalue = i;
					if(_dvalue > 0){
						_moveRange = _dvalue * _onewidth;
					}
				}
			}
			
			//排序
			palyList.sortOn("top", Array.DESCENDING | Array.NUMERIC);
			_tempList.sortOn("top", Array.DESCENDING | Array.NUMERIC);
			
//			if( PlayView.visible && PlayView1.visible || _top == oldTop )
			if(oldTop == 0)
			{//当显示，说明第一次
				showPlayPhoto( PlayView, palyList);
				PlayView.visible = PlayView.mouseChildren = PlayView.mouseEnabled  = true;
//				PlayView1.visible = false;
			}else if( PlayView.visible  && _top != oldTop && oldTop != 0 && oldTop > 5 && _top > 5) {
			//当PlayView是真实的显示的时候，需要更新用来波特效的
//				showPlayerPhotoByMove( PlayView1, palyList);
				if(oldTop > _top){
					if(oldTop <= 10 && _top == 6){
						_moveRange = (oldTop - _top) * _onewidth;
					}
					showPlayerPhotoByMove( PlayView, palyList);
				} else{
					showPlayPhoto( PlayView, palyList);
					PlayView.visible = PlayView.mouseChildren = PlayView.mouseEnabled  = true;
				}
			} else if(_top <= 5){
				showPlayPhoto( PlayView, _tempList);
			} else {
				showPlayPhoto( PlayView, _tempList);
				PlayView.visible = PlayView.mouseChildren = PlayView.mouseEnabled  = true;
			}
//			}else
//			{
//				showPlayerPhotoByMove( PlayView, palyList);
//			}
			
			showRankWarInfor()
			
			getSeverTime();
			if(GameData.SceneType	!=	GameDefine.SceneType_Normal || _model.scene.Role.getPlayerLevel() < 17)
			{
				return;
			}
			if(!AttackLogic.getInstance().fighting && created == false) {
				MultLoader.getInstance().load([StageInfo.swfResPath + "pkListBack.swf"], true, createScene);
			}
		}
		
		private function showPlayerPhotoByMove(playerView:NxViewGroup, val:Array):void
		{
//			PlayView.mouseChildren = PlayView.mouseEnabled = PlayView1.mouseChildren = PlayView1.mouseEnabled = false;
			PlayView.mouseChildren = PlayView.mouseEnabled = false; 
			
			showPlayPhoto(playerView, palyList);
			
			playerView.parent.addChild( playerView );
			
			var xPoint : int = playerView.x;
			var xp:Number	 = xPoint - _moveRange;
			
//			playerView.x = playerView.width + xPoint;
			
			playerView.visible = true;
				
//			TweenLite.to(playerView,2,{x:xp, onComplete:function():void
//			{
//				if( playerView == PlayView )
//				{
//					PlayView1.visible = false;
//					PlayView1.x = xPoint;
//				}else
//				{
//					PlayView.visible = false;
//				}
//				playerView.mouseChildren = playerView.mouseEnabled = true;
//			}  
//			});
			
			var tempRange:int =0;
			var _moveTimer:Timer = new Timer(50, Math.ceil(_moveRange / 10));
			_moveTimer.addEventListener(TimerEvent.TIMER, 
				function timerHandler():void{
					if(PlayView.x - 10 < xp){
						_moveTimer.stop();
					}
					PlayView.x -= 10;
					//重新遮罩
					PlayView.removeChild(_square);
					_square = new Sprite();
					_square.graphics.beginFill(0xFF0000);
					tempRange += 10;
					_square.graphics.drawRect(tempRange, 0, 691, 200);
					PlayView.addChild(_square);
					PlayView.mask = _square;
				}
			);
			_moveTimer.addEventListener(TimerEvent.TIMER_COMPLETE,
				function completeHandler():void{
					_moveTimer.stop();
					palyList = _tempList;
					//重新填充数据
					showPlayPhoto( PlayView, palyList);
					//重新遮罩
					PlayView.removeChild(_square);
					_square = new Sprite();
					_square.graphics.beginFill(0xFF0000);
					_square.graphics.drawRect(0, 0, 691, 200);
					PlayView.addChild(_square);
					PlayView.mask = _square;
					PlayView.x = xPoint;
					playerView.mouseChildren = playerView.mouseEnabled = true;
				}
			);
			_moveTimer.start();
		}
		/**
		 * 更新挑战信息 
		 * @param e
		 * wstring srcName	挑战者
		 * wstring defender 被挑战者
		 * int time			挑战时间
		 * int res			挑战结果
		 * int top			玩家排名
		 */		
		private function onUpdatePkInfo(e:CustomMsgEvent):void
		{
			var list:Array		=	e.pList;
			_pkListInfoArray	=	[];
			var itemStr:String	=	"";
			var name_0:String	=	""
			var name_1:String	=	"";
			var isKOStr:String	=	""
			var numStr:String	=	"";
			var lookWarfare:String ="";
			for(var i:int = 0; i < e.pList.length; i+= 7)
			{
				name_0	=	e.pList[ i + 0];
				name_1	=	e.pList[i +1];
				if(name_0 == _model.scene.Role.getPlayerName())
				{
					name_0	= StaticIni.getSwfLangStr("UIString_1000186")
					name_1	= "<a href='event:linkname_" + name_1 + "'><u>" + StaticIni.getSwfLangStrVar("UIString_1000237",[name_1]) + "</u></a>";
					if(e.pList[i + 3] > 0)
					{
						if(e.pList[i + 4] == e.pList[i + 5])
						{
							numStr	=	StaticIni.getSwfLangStr("UIString_1000181");
						}
						else
						{
							numStr	=	StaticIni.getSwfLangStrVar("UIString_1000194",[e.pList[i + 4]]);	
						}

					}
					else
					{
						numStr	=	StaticIni.getSwfLangStr("UIString_1000181");
					}
				}
				else
				{
					name_0	= "<a href='event:linkname_" + name_0 + "'><u>" + StaticIni.getSwfLangStrVar("UIString_1000237",[name_0]) + "</u></a>";
					name_1	= StaticIni.getSwfLangStr("UIString_1000186")
					if(e.pList[i + 3] > 0)
					{
						numStr	=	StaticIni.getSwfLangStr("UIString_1000181");
					}
					else
					{
						if(e.pList[i + 4] == e.pList[i + 5])
						{
							numStr	=	StaticIni.getSwfLangStr("UIString_1000181");
						}
						else
						{
							numStr	=	StaticIni.getSwfLangStrVar("UIString_1000182",[e.pList[i + 4]]);	
						}
						
					}
				}
				if(e.pList[i + 3] > 0)
				{
					
					isKOStr	=	StaticIni.getSwfLangStr("UIString_1000179");
				}
				else
				{
					isKOStr	=	StaticIni.getSwfLangStr("UIString_1000180");
				}
				lookWarfare =StaticIni.getSwfLangStrVar("UIString_1000490",[e.pList[i + 6]]);
				if(e.pList[i + 6] == -1)
				{
					lookWarfare ="";
				}
				itemStr	=	StaticIni.getSwfLangStrVar("UIString_1000178",[getPkTimeStr(e.pList[i + 2]),name_0,name_1,isKOStr,numStr,lookWarfare]);
				_pkListInfoArray.push(itemStr);
			}
			pkLTxt.htmlText	=	_pkListInfoArray.join("<br>");
		}
		
		private function getPkTimeStr(val:int):String
		{
			val	=	Math.abs(ServerTimerLogic.getInstance().getServerTimer() - val);
			var timeStr:String	=	"";
			if(val > 86400)
			{
				timeStr	=	StaticIni.getSwfLangStrVar("UIStr_1001025", [Math.floor(val / 86400)]);
			}
			else if(val > 3600)
			{
				timeStr	=	Math.floor(val / 3600) + StaticIni.getSwfLangStr("CastleTrain_String6");
			}
			else if(val > 60)
			{
				timeStr	=	Math.floor(val / 60) + StaticIni.getSwfLangStr("Common_Minute");
			}
			else
			{
				timeStr	=	val + StaticIni.getSwfLangStr("Common_Second");
			}
			return timeStr;
		}

		/**
		 * 广播
		 * @param	e
		 */
		private function cloneBroadCaseHandl(e:CustomMsgEvent):void
		{
			var infoList:Array	=	e.pList;
			var strID:String	=	infoList.shift();
			infoLabel_0.htmlStrByBorder	=	"<font size='26'><b>"+ StaticIni.getSwfLangStrVar(strID, infoList)+"</b></font>";
			//infoLabel_0.htmlStrByBorder	=	 StaticIni.getSwfLangStrVar(strID, infoList);
		}
		/**
		 * 请求服务器时间
		 */
		private function getSeverTime():void 
		{
			if (_prizeGold <= 0) 
			{
				infoLabel_1.htmlStrByBorder	=	StaticIni.getSwfLangStr("UIStr_1001739");
			}
			else
			{
				_haveTime	=	_prizeTime	-	ServerTimerLogic.getInstance().getServerTimer();
				
				if (_haveTime >172800) 
				{
					infoLabel_1.htmlStrByBorder	=	StaticIni.getSwfLangStrVar("RankWar_2", [_top,_MoneyNum,_PreNum, StaticIni.getSwfLangStr("UIString_1000663")]);//后天
				}
				else if (_haveTime > 86400)
				{
					infoLabel_1.htmlStrByBorder	=	StaticIni.getSwfLangStrVar("RankWar_2", [_top,_MoneyNum,_PreNum,StaticIni.getSwfLangStr("UIString_1000664")]);//明天
				}
				else
				{
					_timer.start();
				}
			}
		}
		
		/**
		 * 计时器
		 * @param	e
		 */
		private function timerHandle(e:TimerEvent):void
		{
			var timeStr:String	=	getTimeStr(_haveTime);
			infoLabel_1.htmlStrByBorder	=	StaticIni.getSwfLangStrVar("RankWar_2", [_top, _MoneyNum,_PreNum, timeStr]);
			if (_haveTime <= 0) 
			{
				
				_timer.stop();
			}
			else
			{
			
				_haveTime--;
			}
		}
		/**
		 * CD计时器
		 * @param	e
		 */
		private function CDTimerHandle(val:int, col:int):void 
		{
			_pkEnableTime = val	
			if (_pkEnableTime <= 0) 
			{
				//显示进入按钮
				//显示进入按钮
//				ActivityGuideManageUI.getInstance().setActivityTime( StaticIni.getSwfLangStrVar("UIStr_1001745", 
//					[StaticIni.getSwfLangStr("CastleArea_ItemTwoBtnThree_1")] ) ,0 );
				//CDtimelogic.getInstance().setActivityTime(0 ,0 );
				infoLabel_6.htmlStrByBorder	=	"";
				clearCDBtn.visible		=	false;
			}
			else
			{
				clearCDBtn.visible		=	true;
				var timeStr:String		=	getTimeStr(_pkEnableTime);
				infoLabel_6.htmlStrByBorder	=	timeStr.slice(3, timeStr.length);
//				ActivityGuideManageUI.getInstance().setActivityTime(
//					StaticIni.getSwfLangStrVar( "UIStr_1001746", [infoLabel_6.text] ),1 );
			}
		}
		/**
		 * 返回时间的字串
		 * @param	val
		 * @return
		 */
		private function getTimeStr(val:int):String
		{
			var hours:Number;
			var minutes :Number;
			var seconds:Number;
			var hoursStr:String;
			var minutesStr:String;
			var secondsStr:String;
			var timeStr:String
			if (val <= 0) 
			{
				timeStr		=	"00" + ":" + "00" +	":"	+	"00";
			}
			else
			{
				hours		=	Math.floor(val / 3600);
				minutes		=	Math.floor((val - hours * 3600)  / 60);
				seconds		=	val - hours * 3600 - minutes * 60;
				hoursStr	=	hours < 10 ? "0" + String(hours) : String(hours);
				minutesStr	=	minutes < 10 ? "0" + String(minutes) : String(minutes);
				secondsStr	=	seconds < 10 ? "0" + String(seconds) : String(seconds);
				timeStr		=	hoursStr +":" + minutesStr +	":"	+	secondsStr;
			}
			return timeStr;
		}
		/**
		 * 返回所需要的龙金币
		 * @return
		 */
		private function getNeedMagicCoin(val:int):String
		{
			var minutes :Number;
			var seconds:Number;
			var needStr:String	=	"";
			minutes		=	Math.floor(val / 60);
			seconds		=	val  - minutes * 60;
			if (seconds > 0) 
			{
				minutes++;
			}
			needStr	=	String(1 * minutes);
			return needStr;
		}

		/**
		 * 显示信息
		 */
		private function showRankWarInfor():void 
		{
//			infoLabel_2.htmlStrByBorder	=	StaticIni.getSwfLangStrVar("RankWar_3", [_top]);
			infoLabel_5.htmlText	=	StaticIni.getSwfLangStrVar("RankWar_5",[_model.scene.Role.getPlayerName(),getPkTitle(_top),String(_top),(int(_model.scene.Role.getPlayerFightPower()) + int(_model.scene.Role.GetProperties("FightPetPower")))]);
			infoLabel_5.addEventListener(MouseEvent.MOUSE_OVER, showRankWarOver);
			infoLabel_5.addEventListener(MouseEvent.MOUSE_OUT, showRankWarOut);
//			infoLabel_4.htmlStrByBorder	=	StaticIni.getSwfLangStrVar("RankWar_7",[_model.scene.Role.getPlayerName()]);
			
		}
		
		private function showRankWarOver(e:MouseEvent):void
		{
			var str:String = StaticIni.getSwfLangStrVar("UIString_1000735", [_model.scene.Role.getPlayerFightPower(), _model.scene.Role.GetProperties("FightPetPower")]);
			TipsMainLogic.instance.showString(str);
		}
		
		private function showRankWarOut(e:MouseEvent):void
		{
			TipsMainLogic.instance.hide();
		}
		
		/**
		 * 显示可挑战玩家信息
		 * @param	val
		 */
		private function showPlayPhoto(playerView:NxViewGroup, val:Array):void
		{
			clearPhot(playerView);
			for (var i:int = 0; i < val.length; i++) 
			{
				
				var playObj:Object	=	val[i] as Object
				var item:MovieClip	=	playerView.getItemByIndex(i) as MovieClip;
				item.visible		=	true;
				if (item != null) 
				{
					var modelID:String			=	String(val[i]["model"]);
					item["pic"].source 			=	ResourcesPath.getHeadPic(val[i]["model"], val[i]["clotheModel"]==0?1:val[i]["clotheModel"]);
					item["numTxt"].text		=	String(playObj["top"]);
					item["lvTxt"].text			=	"Lv." + String(playObj["level"]);
					item["moneyTxt"].text	=	playObj["moneyNum"];
					item["preTxt"].text	=	playObj["preNum"];
					
					item["roleName"].htmlText	="<a href='event:"+playObj["name"]+"'>"+ playObj["name"]+"</a>";
				}
				item["data"]					=	playObj
			}
			
		}
		/**
		 * 清除图片组
		 */
		private function clearPhot( playerView:NxViewGroup ):void
		{
			for (var i:int = 0; i < 10; i++) 
			{
				var item:MovieClip		=	playerView.getItemByIndex(i) as MovieClip;
				item["pic"].source		=	null;
				item["roleName"].text	=	"";
				item["lvTxt"].text		=	"";
				item["numTxt"].text	=	"";
				item["moneyTxt"].text	=	"";
				item["preTxt"].text	=	"";
				item["data"]			=	null;
			}	
		}
		/**
		 * 初始化图像 
		 */		
		private function infoPic( playerView:NxViewGroup ):void
		{
			for (var i:int = 0; i < 10; i++) 
			{
				
				var backMc:Sprite		=	new Sprite();
				backMc.graphics.beginFill(0xFF8800);
				backMc.graphics.drawRect(0,0,90,135);
				backMc.graphics.endFill();
				backMc.x		=	-15;
				backMc.y		=	-10;
				backMc.alpha	=	0
				var item:MovieClip		=	playerView.getItemByIndex(i) as MovieClip;
				item.visible			=	false;
				var imageMc:MovieClip	=	item.getChildByName("face") as MovieClip;
				var nameTxt:TextField	=	item.getChildByName("T1") as TextField;
				var lvTex:TextField		=	item.getChildByName("T3") as TextField;
				var numTex:TextField	=	item.getChildByName("T2") as TextField;
				var moneyTex:TextField	=	item.getChildByName("T4") as TextField;
				var preTex:TextField	=	item.getChildByName("T7") as TextField;
				var moneyLab:TextField	=	item.getChildByName("T5") as TextField;
				var preLab:TextField	=	item.getChildByName("T6") as TextField;
				var pic:NxClip			=	new NxClip();
				item["pic"]				=	pic;
				item["roleName"]		=	nameTxt;
				item["lvTxt"]			=	lvTex;
				item["numTxt"]			=	numTex;
				item["moneyTxt"]		=	moneyTex;
				item["preTxt"]			=	preTex;
//				var 
				item["moneyTxt"].mouseEnabled = item["preTxt"].mouseEnabled = false;
				(item.getChildByName("T5") as TextField).mouseEnabled = (item.getChildByName("T6") as TextField).mouseEnabled = false;
//				
//				pic.x					=	2;
//				pic.y					=	2;
				imageMc.addChild(pic);
				imageMc.addChild(backMc);
				
				imageMc.mouseEnabled	=	false;
				lvTex.mouseEnabled		=	numTex.mouseEnabled		=	false;
				
				
				var txtStyleName:StyleSheet	=	new StyleSheet();
				
				txtStyleName.setStyle("a:link"		,{color:"#"+StaticIni.getIniVar("Css_a_Task","link"),textDecoration:"underline"});
				txtStyleName.setStyle("a:visited"	,{color:"#"+StaticIni.getIniVar("Css_a_Task","visited")});
				txtStyleName.setStyle("a:hover"	,{color:"#"+StaticIni.getIniVar("Css_a_Task","hover"),textDecoration:"none"});
				
				nameTxt.styleSheet = txtStyleName;
				nameTxt.addEventListener(MouseEvent.CLICK, linkNameHandler);
				

				backMc.addEventListener(MouseEvent.CLICK,backClickHandle);
				
			}
		}
		/**
		 * 挑战镜像
		 * @param	e
		 */
		private function backClickHandle(e:MouseEvent):void
		{
			var clip:Sprite		=	e.currentTarget as Sprite;
			if (clip.parent.parent["data"] == null) 
			{
				return;
			}
			var playName:String		=	clip.parent.parent["data"]["name"];
			if (playName != null && playName != "") 
			{
				SystemSender.getInstance().CustomMsg(CustomToServerFlag.CLIENT_CUSTOMMSG_CHALLENGE_CLONE_PLAYER,new WString(playName));
			}
		}
		/**
		 * 显示TIPS
		 * @param	e
		 */
		private function overHandle(e:MouseEvent):void
		{
			var clip:MovieClip		=	e.currentTarget as MovieClip;
			var playObj:Object		=	clip["data"];
			var topObj:Object		=	StaticIni.getIniObj("TopPrize");
			if (topObj != null && playObj != null) 
			{
				clip.gotoAndStop(2);
				var topStrArray:Array	=	String(topObj[playObj["top"]]).split(",");
				TipsMainLogic.instance.showString(StaticIni.getSwfLangStrVar("UIStr_1001714", [
					playObj["name"], 
					StaticIni.getSwfLangStr("Profession_" + playObj["prof"]),
					playObj["warPower"],
					playObj["top"],
					playObj["title"],
					topStrArray[0],
					topStrArray[1]
					]));
			}
		}
		/**
		 * 关闭TIPS
		 * @param	e
		 */
		private function outHandle(e:MouseEvent):void
		{
			TipsMainLogic.instance.hide();
			
			if( !( e.currentTarget.parent is NxViewGroup ) ) return;
			
			for (var i:int = 0; i < 10; i++) 
			{
				var itemMc:MovieClip	=	e.currentTarget.parent.getItemByIndex(i) as MovieClip
				if(itemMc != null)
				{
					itemMc.gotoAndStop(1);
				}
			}
		}
		/**
		 * 按钮事件
		 * @param	e
		 */
		private function btnClickHandle(e:MouseEvent):void
		{
			var obj:DisplayObject	=	e.target as DisplayObject;
			switch (obj) 
			{
				case role:
					MyPropertyLogic.getInstance().ui.showOrHide()
					break;
				case pack:
					PackLogic.getInstance().ui.showOrHide()
					break;
				case strong:
					EquipModifiedUI.getInstance().showOrHide()
					break;
				case closeBtn:
				case exitBtn:
					this.hide();
//					PlayView.visible = PlayView1.visible = true;
					PlayView.visible = true;
					MainUIManager.getInstance().intoScene();
					SystemSender.getInstance().CustomMsg(CustomToServerFlag.CLIENT_CUSTOMMSG_LEAVE_CLONE_PLAYER_ROOM);
					palyList	=	[];
					break;
				case addNumBtn:
					//addNumBtn.enabled	=	false;
					ClearCDTimeLogic.getInstance().clearCDTime(9999999,"UIStr_1001715",getAddNumMoney()/ 1000);
					LogSendLogic.getInstance().btnClickNumSend(22825)
					break;
				case line:
					EmbattleLogic.getInstance().ui.showOrHide();
					break;
				case lineup:
					StatusShopUI.getInstance().showOrHide();
					SystemSender.getInstance().CustomMsg(CustomToServerFlag.CLIENT_CUSTOMMSG_SHOW_GUILD_DONATE);
					break;
				case clearCDBtn:
					ClearCDTimeLogic.getInstance().clearCDTime(12,"UIString_1000322",int(getNeedMagicCoin(_pkEnableTime)))
					LogSendLogic.getInstance().btnClickNumSend(22826)
					//SystemSender.getInstance().CustomMsg(CustomToServerFlag.CLEINT_CUSTOMMSG_REQUEST_CLEAR_CD,12);
					break;
				case kungfu:
					KungfuPackLogic.getInstance().ui.showOrHide();
					break;
				case channel:
					PulseLogic.getInstance().ui.show();
					break;
				default:
			}
		}
		/**
		 * 显示TIPS
		 * @param	e
		 */
		private function btnOverHandle(e:MouseEvent):void 
		{
			var obj:DisplayObject	=	e.currentTarget as DisplayObject;
			switch (obj)
			{
				case addNumBtn:

					TipsMainLogic.instance.showString(StaticIni.getSwfLangStrVar("UIStr_1001715", [getAddNumMoney()/ 1000]))
					break;
				case infoLabel_1:
					TipsMainLogic.instance.showString(StaticIni.getSwfLangStr("UIStr_1001723"))
					break;
				case clearCDBtn:
				case infoLabel_6:
					TipsMainLogic.instance.showString(StaticIni.getSwfLangStrVar("UIStr_1001823", [getNeedMagicCoin(_pkEnableTime)]));
					break;
				default:
			}
		}
		/**
		 * 添加对象事件
		 */
		public function addItemListent(val:DisplayObject):void
		{
			val.addEventListener(MouseEvent.CLICK, btnClickHandle)
			val.addEventListener(MouseEvent.MOUSE_OVER, btnOverHandle)
			val.addEventListener(MouseEvent.MOUSE_OUT, outHandle)
		}
		/**
		 * 删除对象事件
		 */
		private function removeItemListent(val:DisplayObject):void
		{
			val.removeEventListener(MouseEvent.CLICK, btnClickHandle)
		}
		//查看排行
		private function linkHandler(e:MouseEvent):void 
		{
			PkListRankUI.getInstance().showOrHide()
			//UIManage.getInstance().requestOpenUI(RankUI.getInstance());
		}
		/**
		 * 点击人物qk 
		 * @param e
		 * 
		 */		
		private function linkNameHandler(e:MouseEvent):void
		{
			MenuListManager.clickPkListName((e.currentTarget as TextField).text)
		}
		/**
		 * 添加事件
		 */
		private function addListent():void
		{
			_model			.addEventListener(	String(CustomToClientFlag.SERVER_CUSTOMMSG_SEND_CLONE_CHALLENGE_BROADCAST), cloneBroadCaseHandl);
			_timer			.addEventListener(	TimerEvent.TIMER, timerHandle);	
			PlayView		.addItemsEvent(		MouseEvent.MOUSE_OVER, 	overHandle);
			PlayView		.addItemsEvent(		MouseEvent.MOUSE_OUT, 	outHandle);
//			PlayView1		.addItemsEvent(		MouseEvent.MOUSE_OVER, 	overHandle);
//			PlayView1		.addItemsEvent(		MouseEvent.MOUSE_OUT, 	outHandle);
			addItemListent(addNumBtn);
			addItemListent(infoLabel_1);
			addItemListent(clearCDBtn);
			addItemListent(infoLabel_6);
			addItemListent(closeBtn);
			
			addItemListent(role);
			addItemListent(pack);
			addItemListent(line);
			addItemListent(lineup);
			addItemListent(channel);
			addItemListent(strong);
			addItemListent(kungfu);
			
			addItemListent(exitBtn);
			
			rewardMc1.addEventListener(MouseEvent.MOUSE_OVER, rewardOverHandler);
			rewardMc2.addEventListener(MouseEvent.MOUSE_OVER, rewardOverHandler);
			rewardMc3.addEventListener(MouseEvent.MOUSE_OVER, rewardOverHandler);
			rewardMc4.addEventListener(MouseEvent.MOUSE_OVER, rewardOverHandler);
			rewardMc5.addEventListener(MouseEvent.MOUSE_OVER, rewardOverHandler);
			rewardMc1.addEventListener(MouseEvent.MOUSE_OUT, rewardOutHandler);
			rewardMc2.addEventListener(MouseEvent.MOUSE_OUT, rewardOutHandler);
			rewardMc3.addEventListener(MouseEvent.MOUSE_OUT, rewardOutHandler);
			rewardMc4.addEventListener(MouseEvent.MOUSE_OUT, rewardOutHandler);
			rewardMc5.addEventListener(MouseEvent.MOUSE_OUT, rewardOutHandler);
			
			pkLTxt.addEventListener("link", linkClick);
			_curCloneChallengeTimesIndex	=	_bindManage.BindProp(_model.scene.Role, "CurCloneChallengeTimes", this, "curCloneTimes");
		}
		
		private function linkClick(t:TextEvent):void
		{
			if(t.text.indexOf("key_")!=-1)
			{
				var key:String =t.text.replace("key_","");
				_currSeeWarfar =int(key);
				SystemSender.getInstance().CustomMsg(CustomToServerFlag.CLIENT_CUSTOMMSG_REQUEST_CHALLENGE_DBFIGHT_REPORT,int(key));
			}
			if(t.text.indexOf("linkname_") != -1){
				var name:String = t.text.replace("linkname_","");
				MenuListManager.clickPkListName(name);
			}
		}
		
		public function get currWarfar():int
		{
			return _currSeeWarfar;
		}
		/**
		 * 删除事件
		 */
		private function removeListent():void
		{
			//_model			.removeEventListener(	String(CustomToClientFlag.SERVER_CUSTOMMSG_SEND_CLONE_CHALLENGE_INFO), onUpdatePlay);
			_timer			.removeEventListener(	TimerEvent.TIMER, timerHandle);	
			PlayView		.removeItemsEvent(		MouseEvent.MOUSE_OVER, 	overHandle);
			PlayView		.removeItemsEvent(		MouseEvent.MOUSE_OUT, 	outHandle);
//			PlayView1		.removeItemsEvent(		MouseEvent.MOUSE_OVER, 	overHandle);
//			PlayView1		.removeItemsEvent(		MouseEvent.MOUSE_OUT, 	outHandle);
			removeItemListent(addNumBtn);
			removeItemListent(infoLabel_1);
			removeItemListent(clearCDBtn);
			removeItemListent(infoLabel_6);
			removeItemListent(closeBtn);
			
			removeItemListent(	role	);
			removeItemListent(	pack	);
			removeItemListent(	line	);
			removeItemListent(	lineup	);
			removeItemListent(	channel	);
			removeItemListent(	strong	);
			removeItemListent(	kungfu	);
			removeItemListent(	exitBtn	);
			
			rewardMc1.removeEventListener(MouseEvent.MOUSE_OVER, rewardOverHandler);
			rewardMc2.removeEventListener(MouseEvent.MOUSE_OVER, rewardOverHandler);
			rewardMc3.removeEventListener(MouseEvent.MOUSE_OVER, rewardOverHandler);
			rewardMc4.removeEventListener(MouseEvent.MOUSE_OVER, rewardOverHandler);
			rewardMc5.removeEventListener(MouseEvent.MOUSE_OVER, rewardOverHandler);
			rewardMc1.removeEventListener(MouseEvent.MOUSE_OUT, rewardOutHandler);
			rewardMc2.removeEventListener(MouseEvent.MOUSE_OUT, rewardOutHandler);
			rewardMc3.removeEventListener(MouseEvent.MOUSE_OUT, rewardOutHandler);
			rewardMc4.removeEventListener(MouseEvent.MOUSE_OUT, rewardOutHandler);
			rewardMc5.removeEventListener(MouseEvent.MOUSE_OUT, rewardOutHandler);
		}
		
		/**
		 * 宝箱显示TIPS
		 * 
		 */
		private function rewardOverHandler(e:MouseEvent):void
		{
			var target:DisplayObjectContainer = e.currentTarget as DisplayObjectContainer;
			var glow:GlowFilter		= 	new GlowFilter();
			glow.color 				= 	0xFFFFFF;
			target.filters = [glow];
			switch(target)
			{
				case rewardMc1:
					TipsMainLogic.instance.showString(StaticIni.getSwfLangStr("UIString_1000558"));
					break;
				case rewardMc2:
					TipsMainLogic.instance.showString(StaticIni.getSwfLangStr("UIString_1000557"));
					break;
				case rewardMc3:
					TipsMainLogic.instance.showString(StaticIni.getSwfLangStr("UIString_1000556"));
					break;
				case rewardMc4:
					TipsMainLogic.instance.showString(StaticIni.getSwfLangStr("UIString_1000555"));
					break;
				case rewardMc5:
					TipsMainLogic.instance.showString(StaticIni.getSwfLangStr("UIString_1000554"));
					break;
			}
		}
		
		/**
		 * 宝箱移除TIPS
		 * 
		 */
		private function rewardOutHandler(e:MouseEvent):void
		{
			var target:DisplayObjectContainer = e.currentTarget as DisplayObjectContainer;
			target.filters = [];
			TipsMainLogic.instance.hide();
		}
		
		/**
		 * 增加次的消耗 
		 * @return 
		 * 
		 */		
		private function getAddNumMoney():int
		{
			var val:int				=	_model.scene.Role.GetProperties("CurAddCloneChallenge") +1;
			var needMagicCoin:int	=	0;
			if (val <= 5) 
			{
				needMagicCoin	=	2000 * val;
			}
			else if (val <= 14) 
			{
				needMagicCoin	=	10000;
			}
			else if (val <= 29) 
			{
				needMagicCoin	=	20000;
			}
			else if (val <= 49) 
			{
				needMagicCoin	=	50000;
			}
			else if (val <= 99) 
			{
				needMagicCoin	=	80000;
			}
			else if (val <= 199) 
			{
				needMagicCoin	=	120000;
			}
			else if ( val > 200) 
			{
				needMagicCoin	=	200000;
			}
			return needMagicCoin;
		}
		override public function modifyPostion():void
		{
			
		}
		override protected function AfterHide():void
		{
			this.created = false;
			//MainUIManager.getInstance().intoScene();
			BG.source = null;
			title.source = null;
			back1.source = null;
			back2.source = null;
			pkInfo.source = null;
			jianglibgmc.source = null;
			rewardMc5.source = null;
			rewardMc4.source = null;
			rewardMc3.source = null;
			rewardMc2.source = null;
			rewardMc1.source = null;
			shenyucishumc.source = null;
			if(MultLoader.getInstance().hasSourceByUrl(StageInfo.swfResPath + "pkListBack.swf")){
				MultLoader.getInstance().deletSourceByUrl(StageInfo.swfResPath + "pkListBack.swf");
				ResManager.deleteRes("PkList");
			}
		}
		override protected function BeforeShow():void
		{
			this.created = true;
			var mc :MovieClip = MultLoader.getInstance().getSourceByUrl(StageInfo.swfResPath + "pkListBack.swf");
			//			app=mc.loaderInfo.applicationDomain;
			//			var cla:Object = null ;
			//			if(app.hasOwnProperty("CustomControl_0250"))
			//				 cla= app.getDefinition("CustomControl_0250") as Class;
			//			BG.source = new cla() as DisplayObject ; 
			
			ResManager.SaveRes("PkList",mc);
			if( BG.source	== null  )
			{
				BG.source = ResManager.newResClass("Pklistbg") as MovieClip;
			}
			title.source = ResManager.newResClass("pk_dazi") as MovieClip; 
			back1.maintainAspectRatio = back2.maintainAspectRatio = pkInfo.maintainAspectRatio = false;
			back1.scaleContent = back2.scaleContent = pkInfo.scaleContent = true;
			back1.source = ResManager.newResClass("pk_mainkuang") as MovieClip;
			back2.source = ResManager.newResClass("pk_shangkuang") as MovieClip;
			pkInfo.source = ResManager.newResClass("pk_xiakuang") as MovieClip;
			jianglibgmc.source = ResManager.newResClass("pk_paiming") as MovieClip;
			rewardMc5.source = ResManager.newResClass("pk_diyiming") as MovieClip;
			rewardMc4.source = ResManager.newResClass("pk_qianshiming") as MovieClip;
			rewardMc3.source = ResManager.newResClass("pk_qianwushiming") as MovieClip;
			rewardMc2.source = ResManager.newResClass("pk_qianyibaiming") as MovieClip;
			rewardMc1.source = ResManager.newResClass("pk_qianliangbaiming") as MovieClip;
			shenyucishumc.source = ResManager.newResClass("pk_shuimo") as MovieClip;
			MyAvter.source	=	ResourcesPath.getBigHalfPic(_model.scene.Role.GetPropertiesEx("Model"));
			if(!SceneManager._itemIconLoad)
			{
				_model.addEventListener(LogicEvent.ITEMICONLOADED, loaded);
				function loaded():void
				{
					SystemSender.getInstance().CustomMsg(CustomToServerFlag.CLIENT_CUSTOMMSG_ENTRY_CLONE_PLAYER_ROOM);
					_model.removeEventListener(LogicEvent.ITEMICONLOADED, loaded)
				}
			}
			//			BeforeShow();
		}
		override public function show(space:DisplayObjectContainer=null, onshow:Function=null, ...argc):void
		{
			
		}
		
		/**
		 *加载资源 
		 */		
		private var app:ApplicationDomain
		private function createScene():void
		{
			MainUIManager.getInstance().intoScene(GameDefine.SceneType_Clone);
			
		}
	}

}